package com.jwds.digital.bios.business.api.controller.belt;


import com.jwds.digital.bios.business.core.infrastructure.dto.belt.BeltMotorHistoryDayDTO;
import com.jwds.digital.bios.business.core.infrastructure.vo.belt.BeltMotorHistoryDayVO;
import com.jwds.digital.bios.business.service.service.belt.IBeltMotorHistoryDayService;
import com.jwds.tdc.framework.application.lib.BaseResponse;
import com.jwds.tdc.framework.application.lib.page.PageRequest;
import com.jwds.tdc.framework.application.lib.page.PageResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

/**
 * 电机历史数据天表 前端控制器
 *
 * @author 席鹏程
 * @date 2024-11-14
 */
@Slf4j
@Api(tags = "电机历史数据天表")
@RestController
@RequestMapping("/belt/motor/history/day")
public class BeltMotorHistoryDayController {

    @Resource
    private IBeltMotorHistoryDayService service;


    @PostMapping("/list")
    @ApiOperation(value = "分页查询")
    public BaseResponse<PageResponse<BeltMotorHistoryDayVO>> page(@Valid @RequestBody PageRequest<BeltMotorHistoryDayDTO> pageRequest) {
        PageResponse<BeltMotorHistoryDayVO> respVoPage = service.page(pageRequest);
        return BaseResponse.success(respVoPage);
    }

    @PostMapping("/all")
    @ApiOperation(value = "列表查询")
    public BaseResponse<List<BeltMotorHistoryDayVO>> list(@Valid @RequestBody BeltMotorHistoryDayDTO reqDto) {
        List<BeltMotorHistoryDayVO> respVoList = service.list(reqDto);
        return BaseResponse.success(respVoList);
    }



}
